package com.situ.service.impl;

import com.situ.dao.MovieDao;
import com.situ.dao.impl.MovieDaoImpl;
import com.situ.pojo.Movie;
import com.situ.pojo.search.MovieDTO;
import com.situ.service.MovieService;
import com.situ.util.BeanFactory;
import com.situ.util.Pagination;

import java.util.List;

public class MovieServiceImpl implements MovieService {
    private MovieDao movieDao= BeanFactory.getBean(MovieDaoImpl.class);

    @Override
    public List<Movie> list(MovieDTO movieDTO, Pagination pagination) {
        return movieDao.list(movieDTO, pagination);
    }

    @Override
    public Boolean add(Movie movie) {
        return movieDao.add(movie) > 0;
    }

    @Override
    public Movie findById(Integer integer) {
        return movieDao.findById(integer);
    }

    @Override
    public Boolean edit(Movie movie) {
        return movieDao.edit(movie) > 0;
    }

    @Override
    public int deleteByIds(List<Integer> integers) {
        return movieDao.deleteByIds(integers);
    }
}
